package com.springcloud.test;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Desc TODO
 * ----------------
 * @CLASS_NAME: DcController
 * ----------------
 * @Author jovi
 * ----------------
 * @Date 2020-03-24 15:41
 */
@RestController
public class DcController {

    @PostMapping(value = "/uploadFile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public String uploadFile(@RequestPart(value = "file") MultipartFile file) {
        String name = file.getName();
        System.out.println(name);

        return name;
    }

}
